<?php
class Model_Chap extends Model {
		public  $table="playlist";
		public	$cat="news";

	
	
		public function add_chap($data)
		{
			return $this->insert($this->table,$data);
			
		}

		public function update_chap($data)
		{
			return $this->update($this->table,$data);
		}
		
		public function get_chap()
		{	
			$this->getdata($this->table);
		}
		
		
		public function get_list_chap($id)
		{	
			$this->select=" chap_id,chap_title,chap_alias,chap_thutu ";
			$this->where=" chap_parent = $id ";
			$this->order=" chap_thutu asc ";
			$this->getdata($this->table);
		}
		
	
		public function delete_chap($id)
		{	$this->where="chap_id=$id";
			return $this->delete($this->table);
				
		}
	
		public function get_news()
		{	$this->select="id, tieude ";
			$this->order="tieude asc";
			$this->getdata($this->cat);
		}
		
	

	
}
